package com.shadow.controller;

import com.shadow.common.bo.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("springboot")
public class SysController {

    /**
     * 定时任务列表页
     *
     * */
    @GetMapping("handHandler")
    public R handHandler() {
        log.info("===== hand handler start");
        handler();
        log.info("===== hand handler end");
        return R.success();
    }

    @Scheduled(cron = "0 0/1 * * * ?")
    private void handler() {
        log.debug("===== handler");
        log.info("===== handler");
        log.warn("===== handler");
        log.error("===== handler");
    }
}
